let person: string = 'niuniui'
let age: number = 18
let flag: boolean = true
let un: undefined = undefined
let nu: null = null
let sy: symbol = Symbol('22')
// let big: bigint = 100n
// let obj: object = {person, age}

person = null
person = undefined
// person = 123  null 和 undefined 会被判断为其他类型的子类型可以赋值

function foo(): string {
  // return 1
  return 'niuniu'
}


const arr1: string[] = ['1', '2']
const arr2: Array<string> = ['1', '2']   // Array<T> 泛型

// 元组 tuple
const arr3: [string, number?, boolean?] = ['1', 2]
// console.log(arr3[100]);

const arr4: [name: string, age: number] = ['niuniu', 18]
const [el1, el2, ...rest] = arr4


interface IDescription {
  readonly name: string
  age: number
  gender: boolean
  like?: string
}

const obj1: IDescription = {
  name: 'niuniu',
  age: 18,
  gender: true,
  // like: 'football'
}

// obj1.name = 'sjk'
